﻿<UserControl x:Class="ViCode_LeVi.Controls.VMTaskItemGroupSummary"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:vmcontrol="clr-namespace:ViCode_LeVi.Controls"
        xmlns:Langs="clr-namespace:ViCode_LeVi.Langs"
        xmlns:Data="clr-namespace:ViCode_LeVi.Data">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <ListView Name="ListView_Tasks" Grid.Column="0" Grid.Row="0" 
                              ItemsSource="{Binding .}"
                              SelectionMode="Single">
            <ListView.View>
                <GridView>
                    <GridViewColumn DisplayMemberBinding="{Binding ID}">
                        <GridViewColumn.Header>
                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_ID_Text"/>
                        </GridViewColumn.Header>
                    </GridViewColumn>
                    <GridViewColumn DisplayMemberBinding="{Binding Name}">
                        <GridViewColumn.Header>
                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_Name_Text"/>
                        </GridViewColumn.Header>
                    </GridViewColumn>
                    <GridViewColumn >
                        <GridViewColumn.Header>
                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_IsActive_Text"/>
                        </GridViewColumn.Header>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <CheckBox IsChecked="{Binding Active}"      VerticalAlignment="Center"  />
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn x:Name="GridViewColumn_Define">
                        <GridViewColumn.Header>
                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_Define_Text"/>
                        </GridViewColumn.Header>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <vmcontrol:VMTextBlockNoWrap TextWrapping="NoWrap" TextTrimming="WordEllipsis" Text="{Binding Define}"      VerticalAlignment="Center"  />
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn  >
                        <GridViewColumn.Header>
                            <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_WeightText"/>
                        </GridViewColumn.Header>
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <ProgressBar Height="15" Minimum ="1" Maximum="10" Value="{Binding Weight}"  />
                                    <vmcontrol:VMTextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Weight}"/>
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>
        <GroupBox  Grid.Column="0" Grid.Row="2"  DataContext="{Binding ElementName =  ListView_Tasks, Path = SelectedItem}" >
            <GroupBox.Header>
                <vmcontrol:VMTextBlockExt_ControlTextInfoInData TextPath="TaskItem_Control_Detail_Text"/>
            </GroupBox.Header>
            <Grid IsEnabled="{Binding IsEnableChangeInfo, Mode = OneWay}"
              >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Right" TextPath="TaskItem_Name_Text" Margin="2"/>
                <vmcontrol:VMTextBox  Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Stretch" Text="{Binding Name}" Margin="2"/>

                <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" TextPath="TaskItem_WeightText" Margin="2"/>
                <!--<vmcontrol:VMTextBox Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Text="{Binding Weight}" Margin="2"/>-->
                <StackPanel Grid.Column="1" Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" >
                    <Slider  Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left" Minimum="1" Maximum="10" Value="{Binding Weight}" IsSnapToTickEnabled="True" TickFrequency="1"/>
                    <vmcontrol:VMTextBlock Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Text="{Binding Weight}" Margin="2"/>
                </StackPanel>
                
                <vmcontrol:VMTextBlockExt_ControlTextInfoInData Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" TextPath="TaskItem_WeightReasonText" Margin="2"/>
                <vmcontrol:VMTextBox_MultiLine  Grid.Column="1" Grid.Row="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Text="{Binding ReasonDescription4Weight}" MinLines="3" Margin="2"/>

            </Grid>
        </GroupBox>
    </Grid>
</UserControl>
